package main

import "fmt"

type Prototype interface {
	Clone() Prototype
}

type Student struct {
	Name string
	Age  int
}

func (s *Student) Clone() Prototype {
	return &Student{
		Name: s.Name,
		Age:  s.Age,
	}
}

func main() {
	s1 := &Student{
		Name: "小明",
		Age:  18,
	}
	s2 := s1.Clone()
	s3 := s2.Clone()
	fmt.Println(s1, s2, s3)
	fmt.Printf("%p\n", s1)
	fmt.Printf("%p\n", s2)
	fmt.Printf("%p\n", s3)
}
